//
//  LKDesTypeTBC.m
//  QuickCure
//
//  Created by 胡不归是大虾 on 9/13/16.
//  Copyright © 2016 haoge. All rights reserved.
//

#import "LKDesTypeTBC.h"
static NSString* identifier = @"cell";
@interface LKDesTypeTBC ()
@property(nonatomic,strong)NSArray* dataArray;

@end

@implementation LKDesTypeTBC

- (void)viewDidLoad {
    [super viewDidLoad];
    //注册cell
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:identifier];
    self.tableView.tableFooterView = [UIView new];
    //修改标题
    self.navigationItem.title = @"疾病类型";
    
}
#pragma mark - TableView数据源方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return self.dataArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath];
    //设置标题
    cell.textLabel.text = self.dataArray[indexPath.row];
    //设置右边箭头
    UIImageView* arrowImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"jt"]];
    cell.accessoryView = arrowImageView;
    
    return cell;
}
#pragma mark--TableView代理方法
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    //调用block传值
    if (_desTypeBlock) {
       
        _desTypeBlock(self.dataArray[indexPath.row]);
    }
    //推出控制器
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark--数据懒加载
-(NSArray *)dataArray
{
    if (!_dataArray) {
        _dataArray = @[@"肿瘤科",@"心血管科",@"血液科",@"神经科",@"骨科"];
    }
    return _dataArray;
}

@end;